<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="客户下单帐号" />
<%@ include file="../inc/Title.jsp"%>
<head>
<link rel="stylesheet" type="text/css" href="/css/base.css" />
<script src="/js/popup_ext.js"></script>
<script language="javascript">
	function doNew(){
		var url="/system/ClieUserNew.ihtm";
		ShowIframeNoScroll("客户下单帐号",url,400,360,"refreshWin()",700,530);
	}
	function doEdit(id){
		var url="/system/ClieUserEdit.ihtm?id="+id;
		ShowIframeNoScroll("客户下单帐号",url,400,360,"refreshWin()",700,530);
	}
	function refreshWin(){
		window.location.reload(true);
	}
	function doDelete(id){
		ShowConfirm('确认框','确定删除吗？',340,80,"doDelAct("+id+")");
	}
	function doDelAct(id){
		if(popRetVal!=null){
			var fromUrl=encodeURIComponent("/system/ClieUserList.ihtm");
			window.location="/system/ClieUserDelete.ihtm?id="+id+"&from_url="+fromUrl;
		}
	}
	function doCancel(){
		window.close();
	}
	function doPause(id,flag){
		var fromUrl=encodeURIComponent("/system/ClieUserList.ihtm");
		window.location="/system/ClieUserPause.ihtm?id="+id+"&flag="+flag+"&from_url="+fromUrl;
	}
	function checkSearchKey(){
		if(window.event.keyCode==13){
			doSearch();
		}
	}
	function doSearch(){
		var searchKey=encodeURIComponent(document.getElementById("search_key").value.trim());
		window.location="/system/ClieUserList.ihtm?search_key="+searchKey;
	}
</script>
</head>
<body oncontextmenu="return false" class="sheet" style="padding-top:10px;text-align:center;">
<div class="sheet-main" style="width:660px;text-align:left;margin:auto;">
  <div class="sheet-top">
    <div class="content">
      <h2>客户下单帐号</h2>
      <p>用于分配给同行登录在线网络下单系统的帐号；余额不足的判断是基于客户当前的欠款 扣减 该客户的信用额度 进行的，只有客户的欠款超过了信用额度，才表示余额不足。</p>
    </div>
  </div>
  <div class="sheet-list">
    <div class="search-business">
	    <div class="add_content"> 	
	    	 <div align="right">
	    	 <input type="text" class="TextBox" id="search_key" name="search_key" onKeyUp="checkSearchKey();" style="width:100px" value="${searchKey}" title="以帐户、客户或者客户拼音字头进行模糊查询">
	    	 <input type="button" class="buttom search-but" value=" 查 询" onClick="doSearch();" title="以帐户、客户或者客户拼音字头进行模糊查询">
	    	 <input type="button" class="buttom search-add" value=" 新 增 " onClick="doNew();">
	    	 </div>
	     </div>
	     <%@include file="../inc/AlertMsg.jsp"%>
	     <div class="table-list">
	     	<table width="100%">
		        <tr>
					<th width="12%">登录帐号</th>
					<th width="20%">客户</th>
					<th width="15%">单据所属帐套</th>
					<th width="10%">价格类型</th>
					<th width="18%">下单类型</th>
					<th width="10%">状态</th>
					<th width="15%">操作</th>
				</tr>
				<c:forEach var="item" items="${list}">
				<tr>
					<td>${item[1]}</td>
					<td>${item[2]}</td>
					<td><commonTag:showSimpleObjectName list="${tsList}" objectId="${item[6]}" /></td>
					<td>
						<c:if test="${item[4]=='STAN'}"><span style="color:blue">标准价</span></c:if>
						<c:if test="${item[4]=='CLIE'}">客户价</c:if>
					</td>
					<td>
						<c:if test="${item[5]=='UP_ZERO'}">余额不足不能下单</c:if>
						<c:if test="${item[5]=='LOW_ZERO'}"><span style="color:blue">余额不足可以下单</span></c:if>
					</td>
					<td>
						<c:if test="${item[3]=='N'}"><font color="#ff0000">停用</font></c:if>
						<c:if test="${item[3]=='Y'}">正常</c:if>
					</td>
					<td>
						<a href="javascript:doEdit('${item[0]}');">编辑</a>
						<c:if test="${item[3]=='N'}"><a href="javascript:doPause('${item[0]}','Y');">启用</a></c:if>
						<c:if test="${item[3]=='Y'}"><a href="javascript:doPause('${item[0]}','N');">停用</a></c:if>
						<a href="javascript:doDelete('${item[0]}');">删除</a>
					</td>
				</tr>
				</c:forEach>
			</table>
		</div>  
	   </div>  
  </div>
<div class="blank12"></blank>
</div>
</body>
</html>
